import { SkillCategoryModel } from '../../models/SkillCategory'

export default defineEventHandler(async (event) => {
  try {
    const categories = await SkillCategoryModel.getAll()
    
    return {
      success: true,
      message: '获取技能分类成功',
      data: categories
    }
  } catch (error: any) {
    console.error('获取技能分类失败:', error)
    
    return {
      success: false,
      message: `获取技能分类失败: ${error.message}`,
      data: null
    }
  }
})